import SelectUtil from '@/SelectUtil';
import UnitCommon from 'code/Core/Common/UnitCommon';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 火焰攻击
 **/
export default class MSK_FireAttack extends AbilityBase {
    static instance: MSK_FireAttack;
    constructor(id: string = 'Myh0') {
        super(id);
        MSK_FireAttack.instance = this;
        this.init();
        EventManager.onTakeAttack(this.onSpellEffect.bind(this));
    }
    init() {}
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {}
    onSpellEffect(d: DamageEventData) {
        if (GetUnitAbilityLevel(d.source, this.id) == 0) return;
        let at = UnitCommon.取攻击(d.source) * 0.5;
        let es = SelectUtil.getEnemyUnitsInRange(d.source, 275);
        DamageSystemInstance.applyAoeMagicDamage(es, d.source, at, 'fire');
    }
}
